﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;
using RaveEngine.Engine.Query;

namespace RaveEngine.Engine
{
    public class QueryHelpers
    {
        public static string PostProcessRegex(string s, postExecuteRegex[] postRegex)
        {
            string sReturn = s;
            Regex regex;

            for (int i = 0; postRegex != null && i < postRegex.Length; i++)
            {
                regex = new Regex(postRegex[i].regularExpression, RegexOptions.Compiled);
                sReturn = regex.Replace(sReturn, postRegex[i].replaceString);
            }

            return sReturn;
        }
    }
}